'''
    while 循环
    for 循环

    break:终止循环
    continue: 终止
    :return: 也可以终止循环
'''

# i =1
# while i <= 100:
#     print("大错特错！！错错错")
#     i += 1

# 打印9行9列的矩形
# j = 1
# while j <= 9:
#     m = 1
#     while m <= 9:
#         print("*",end=" ")
#         m += 1
#     print("")
#     j += 1

#直角三角形
j = 1
while j <= 9:
    m = 1
    while m <= j:
        print("*",end=" ")
        m += 1
    print("")
    j += 1

# 打印九九乘法表
# j = 1
# while j <= 9:
#     m = 1
#     while m <= j:
#         print("%d*%d=%d "%(j,m,j*m),end=" ")
#         m += 1
#     print("")
#     j += 1

# resultSum = 0
# i =1
# while i <= 100:
#     resultSum += i
#     i += 1
# print(resultSum)

# resultSum = 0
# i =1
# while i <= 100:
#     if i % 2 == 0:
#         resultSum += i
#     i += 1
# print(resultSum)

# 遍历容器 像字符串 列表 集合...

str1 = "hello everyone"
alist =[12,312,4,2,4,2,423,23,2]
#直接遍历对象本身
for s in str1:
    print(s)
for a in alist:
    print(a)

# 指定区间遍历
for i in range(0,10):
    print(i)

for i in range(0,10,2):
    print(i)

for i in range(10,0,-1):
    print(i)

for c in range(0,len(str1)):
    print(c)
    print(str1[c])

resultSum = 0
for i in range(0,101):
    if i % 2 == 0:
        resultSum += i
print(resultSum)

# for i in range(1,9):
#     for j in range(1,i+1):
#         print("%d*%d=%d "%(i*j=),end="")
#     print("")

# while True:
#     n = int(input("人工服务0 查询话费 1 查询流量2 充值3 挂机4"))
#     if n == 0:
#         print("很高兴为您服务")
#     elif n == 1:
#         print("99元")
#     elif n == 2:
#         print("您当前流量还有200G")
#     elif n == 3:
#         print("请输入充值金额")
#     elif n == 4:
#         print("再见")
#         break
#     else:
#         print("输入有误")




